From: Florian Müllner Date: Fri, 12 Oct 2012 20:37:18 +0000 (+0200) Subject: st-entry: Force a relayout if necessary X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5608 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=487749c25b35096dfcb1817f2e667714440d8045;p=gnome-shell.git st-entry: Force a relayout if necessary ClutterText will only queue a relayout after font changes if it has any contents other than the empty string. As a result, its height request may change after the first character has been entered. To avoid this visual glitch, force a relayout on actual font changes. https://bugzilla.gnome.org/show_bug.cgi?id=685534 --- diff --git a/src/st/st-entry.c b/src/st/st-entry.c index c6b8701f8..ad9b3a84f 100644 --- a/src/st/st-entry.c +++ b/src/st/st-entry.c @@ -242,7 +242,7 @@ st_entry_style_changed (StWidget *self) StThemeNode *theme_node; ClutterColor color; const PangoFontDescription *font; - gchar *font_string; + gchar *font_string, *font_name; gdouble size; theme_node = st_widget_get_theme_node (self); @@ -264,8 +264,12 @@ st_entry_style_changed (StWidget *self) font = st_theme_node_get_font (theme_node); font_string = pango_font_description_to_string (font); + font_name = g_strdup (clutter_text_get_font_name (CLUTTER_TEXT (priv->entry))); clutter_text_set_font_name (CLUTTER_TEXT (priv->entry), font_string); + if (strcmp (clutter_text_get_font_name (CLUTTER_TEXT (priv->entry)), font_name) != 0) + clutter_actor_queue_relayout (priv->entry); g_free (font_string); + g_free (font_name); ST_WIDGET_CLASS (st_entry_parent_class)->style_changed (self); }